<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="/static/lib/html5shiv.js"></script>
<script type="text/javascript" src="/static/lib/respond.min.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <!--/meta 作为公共模版分离出去-->

    <title>添加用户 - H-ui.admin v3.1</title>
    <meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
    <meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
    <form action="{% url 'new_admin:member_mod_check' %}" target="_parent" method="post" class="form form-horizontal" id="form-member-add">
        {% csrf_token %}
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>姓名：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{{ student.realname }}" required id="username" name="username">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出生年月日：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{{ student.birthday|date:'Y-m-d' }}" placeholder="例如: xxxx-xx-xx" required id="username" name="birthday">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="sex" value="1" {% if student.gender == 1 %} checked {% endif %} type="radio" required id="sex-1" >
                    <label for="sex-1">男</label>
                </div>
                <div class="radio-box">
                    <input type="radio" value="0" id="sex-2" name="sex" {% if student.gender == 0 %} checked {% endif %}>
                    <label for="sex-2">女</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red ">*</span>手机：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text photo" value="{{ student.mobile_number }}" placeholder="请输入手机号" required id="mobile" name="mobile">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="请输入邮箱@" value="{{ student.user.email }}" required name="email" id="email">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>身份证号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input class="input-text id_card" type="text" value="{{ student.id_card }}" required name="IDcar" placeholder="请输入身份证号">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>家庭住址：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input class="input-text" type="text" value="{{ student.home_address }}" placeholder="请输入家庭住址: xx省xx市xx县" required name="city">
            </div>
        </div>
        {#        <div class="row cl">#}
        {#            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>班级：</label>#}
        {#            <div class="formControls col-xs-8 col-sm-9"> <span class="select-box form-group">#}
        {#				<select class="select" size="1" name="class_grade">#}
        {#					<option value="0" selected>请选择班级</option>#}
        {#                    {% for class in class_grade %}#}
        {#                        <option value="{{ class.id }}" {% for s_c in stu_class %}#}
        {#                                {% if student.id == s_c.student.id %}#}
        {#                                {% if class.id == s_c.grade.id %}#}
        {#                                    selected#}
        {#                                {% endif %}#}
        {#                                {% endif %}#}
        {#                            {% endfor %} >{{ class.classname }}</option>#}
        {#                    {% endfor %}#}
        {##}
        {#				</select>#}
        {#				</span> </div>#}
        {#        </div>#}
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>角色类型：</label>
            <div class="formControls col-xs-8 col-sm-9"> <span class="select-box form-group">
				<select class="select" size="1" name="role">
					<option value="0" selected>类型</option>
                    {% for user in user_role %}
                        <option value="{{ user.id }}" {% if student.role_id == user.id %} selected {% endif %}>{{ user.role_name }}</option>
                    {% endfor %}
				</select>
				</span> </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学历：</label>
            <div class="formControls col-xs-8 col-sm-9"> <span class="select-box form-group">
				<select class="select" size="1" name="edu_level">
					<option value="0" selected>请选择学历</option>
					<option value="小学" {% if student.edu_level == '小学' %} selected {% endif %} >小学</option>
					<option value="初中" {% if student.edu_level == '初中' %} selected {% endif %}>初中</option>
					<option value="高中" {% if student.edu_level == '高中' %} selected {% endif %}>高中</option>
					<option value="专科" {% if student.edu_level == '专科' %} selected {% endif %}>专科</option>
					<option value="本科" {% if student.edu_level == '本科' %} selected {% endif %}>本科</option>
					<option value="硕士" {% if student.edu_level == '硕士' %} selected {% endif %}>硕士</option>
				</select>
				</span> </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">简介：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea name="info" cols="" rows=""  class="textarea"  placeholder="说点什么...最少输入10个字符" onKeyUp="$(this).Huitextarealength(this,140)">{{ student.info }}</textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/140</p>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                <input type="hidden" name="s_id" value="{{ student.id }}">
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        $("#tab-category").Huitab({
            index:0
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>

<script>
    $('form').submit(function () {
        photo = $('.photo').val();
        card = $('.id_card').val();
        var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
        if(!myreg.test(photo)) {
            alert('请输入正确的手机号');
            return false;
        } else {
            var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            if(reg.test(card) === false)
            {
                alert("身份证输入不合法");
                return  false;
            }
            return true;
        }
    })
</script>
